//
//  ChooseIDViewController.m
//  PropertyManager
//
//  Created by TNG on 2018/9/28.
//  Copyright © 2018年 Tng. All rights reserved.
//

#import "ChooseIDViewController.h"

@interface ChooseIDViewController ()

@property (strong, nonatomic) UIImageView * carImg;
@property (strong, nonatomic) UIImageView * goodImg;
@property (strong, nonatomic) UILabel * carNameLabel;
@property (strong, nonatomic) UILabel * goodNameLabel;
@property (strong, nonatomic) UILabel * warnLabel;

@end

@implementation ChooseIDViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"注册成为";
    [self wr_setNavBarShadowImageHidden:YES];
    self.view.backgroundColor = SFMNavBarColor;
    [self.view addSubview:self.carImg];
    [self.carImg addSubview:self.carNameLabel];
    [self.view addSubview:self.goodImg];
    [self.goodImg addSubview:self.goodNameLabel];
    [self.view addSubview:self.warnLabel];
}

-(UIImageView *)carImg
{
    if (_carImg == nil) {
        _carImg = [[UIImageView alloc] initWithFrame:CGRectMake(WIDTH/2 - 63, 60 + kStatusAndNavBarH, 126, 126)];
        _carImg.layer.cornerRadius = 63;
        _carImg.clipsToBounds = YES;
        _carImg.backgroundColor = [UIColor whiteColor];
        _carImg.userInteractionEnabled = YES;
        [_carImg addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(cartImgClick)]];
    }
    return _carImg;
}

-(UILabel *)carNameLabel
{
    if (_carNameLabel == nil) {
        _carNameLabel =[[UILabel alloc]initWithFrame:CGRectMake(0, 50, 126, 26)];
        _carNameLabel.font =font(14);
        _carNameLabel.textColor=SFM51;
        _carNameLabel.textAlignment=NSTextAlignmentCenter;
        _carNameLabel.text = @"租户";
    }
    return _carNameLabel;
}

-(UIImageView *)goodImg
{
    if (_goodImg == nil) {
        _goodImg = [[UIImageView alloc] initWithFrame:CGRectMake(WIDTH/2 - 63, 60 + CGRectGetMaxY(self.carImg.frame), 126, 126)];
        _goodImg.layer.cornerRadius = 63;
        _goodImg.clipsToBounds = YES;
        _goodImg.backgroundColor = [UIColor whiteColor];
        _goodImg.userInteractionEnabled = YES;
        [_goodImg addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(goodImgClick)]];
    }
    return _goodImg;
}

-(UILabel *)goodNameLabel
{
    if (_goodNameLabel == nil) {
        _goodNameLabel =[[UILabel alloc]initWithFrame:CGRectMake(0, 50, 126, 26)];
        _goodNameLabel.font =font(14);
        _goodNameLabel.textColor=SFM51;
        _goodNameLabel.textAlignment=NSTextAlignmentCenter;
        _goodNameLabel.text = @"工作人员";
    }
    return _goodNameLabel;
}

-(UILabel *)warnLabel
{
    if (_warnLabel == nil) {
        _warnLabel =[[UILabel alloc]initWithFrame:CGRectMake(0, HEIGHT - kHomeLineH - 30, WIDTH, 20)];
        _warnLabel.font =font(13);
        _warnLabel.textColor=SFMWhiteColor;
        _warnLabel.textAlignment=NSTextAlignmentCenter;
        _warnLabel.text = @"身份确认后将不能修改";
    }
    return _warnLabel;
}

#pragma mark - 租户
-(void)cartImgClick
{
    [self pushRegistAndType:0];
}

#pragma mark - 工作人员
-(void)goodImgClick
{
    [self pushRegistAndType:1];
}

-(void)pushRegistAndType:(NSInteger)type
{
    ReallyNameCertifyViewController * ctr = [[ReallyNameCertifyViewController alloc] init];
    ctr.isRegist = YES;
    [self.navigationController pushViewController:ctr animated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
